//
//  Protocols.hpp
//  VideoParse
//
//  Created by xiaerfei on 2020/2/10.
//  Copyright © 2020 erfeixia. All rights reserved.
//

#ifndef Protocols_hpp
#define Protocols_hpp
#include <stdio.h>
#include <iostream>
#include "URLContext.hpp"

class URLProtocol {

public:
    std::string name;
    int priv_data_size;
    int flags;
    std::string default_whitelist;
    virtual int     url_open(char *url, int flag) = 0;
//    virtual int     url_open2(URLContext *h, const char *url, int flags) = 0;
//    virtual int     url_accept(URLContext *s, URLContext **c) = 0;
//    virtual int     url_handshake(URLContext *c) = 0;
    virtual int     url_read(char *buf, int size) = 0 ;
    virtual int     url_write(URLContext *h, const unsigned char *buf, int size) = 0 ;
    virtual int64_t url_seek( URLContext *h, int64_t pos, int whence) = 0 ;
    virtual int     url_close(URLContext *h) = 0 ;
//    virtual int     url_read_pause(URLContext *h, int pause) = 0 ;
//    virtual int64_t url_read_seek(URLContext *h, int stream_index, int64_t timestamp, int flags) = 0 ;
    virtual int     url_get_file_handle(URLContext *h) = 0 ;
//    virtual int     url_get_multi_file_handle(URLContext *h, int **handles, int *numhandles) = 0 ;
//    virtual int     url_get_short_seek(URLContext *h) = 0 ;
//    virtual int     url_shutdown(URLContext *h, int flags) = 0 ;
//    virtual int     url_check(URLContext *h, int mask) = 0 ;
//    virtual int     url_open_dir(URLContext *h) = 0 ;
//    virtual int     url_read_dir(URLContext *h) = 0 ;
//    virtual int     url_close_dir(URLContext *h) = 0 ;
//    virtual int     url_delete(URLContext *h) = 0 ;
//    virtual int     url_move(URLContext *h_src, URLContext *h_dst) = 0 ;
};



#endif /* Protocols_hpp */
